// Platinum UDP Squak.cpp : Defines the entry point for the console application.
//

#include "platinum.h"
#include <iostream>
#include <sstream>

int main(int argc, char* argv[])
{

	if(argc >= 4){
				
		using namespace Platinum::Net;
				
		int times,port;
		std::string IP;

		times = atoi(argv[1]);
		IP = argv[2];
		port  = atoi(argv[3]);
		int sock = MakeSocket();
		
		UDP::Sender* MySender = new UDP::Sender(IP,port,sock);
		std::string sBuf;
		
		for(int count = 4; count < argc; count++)
			sBuf += argv[count];
		
		for (int x = 0; x < times; x++)
			MySender->Send(sBuf);
		
		std::cout << "Sent: " << sBuf << " to host " << IP << " on port " << port << " " << times <<" times." << std::endl;
		
	}else{
			std::cout << "usage: COUNT IP PORT MESSAGE " << std::endl;
	}
}
